home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-06-23 | 1.4 KB | 54 lines |
- /*
- * QuickTime for Java SDK Sample Code
-
- Usage subject to restrictions in SDK License Agreement
- * Copyright: © 1996-1999 Apple Computer, Inc.
-
- */
- package mixer.display;
-
- import java.awt.*;
- import java.util.*;
- import javax.swing.*;
-
- import quicktime.*;
- import quicktime.app.audio.*;
-
- import mixer.mc.*;
-
- /** This class is a wrapper to group all of the sound types that can be soloed. A channel
- * that can be soloed needs to know which control it came from because that is the only
- * object who can find all of its sibling channels and solo out the correct ones.
- */
- public class SoloableChannels extends JPanel {
- private MixerComponents[] channels;
- private int soloCount = 0;
-
- public SoloableChannels (MixerComponents[] mc) throws QTException {
- channels = mc;
-
- if (channels != null) {
- for (int i = 0; i < channels.length; i++) {
- ChannelDisplay channel = new SoundTrackDisplay (this, channels[i]);
- add(channel);
- }
- }
- }
-
- /* When a child changes its solo state, it invokes this method with its new solo
- * state. This method then calls the doSolo method on each child to get the actual
- * work of soloing completed.
- */
- void setSolo (boolean set) throws QTException {
- if (channels == null) return;
-
- if (set)
- soloCount++;
- else
- soloCount--;
-
- Component[] ar = getComponents();
- for (int i = 0; i < ar.length; i++)
- ((SoundTrackDisplay)ar[i]).doSolo (soloCount);
- }
- }